package cn.com.xuxiaowei.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @author xuxiaowei
 */
@Data
@Component
@ConfigurationProperties(prefix = "spring.datasource.dynamic")
public class DynamicDataSourceProperties {

	private String primary = "master";

	private boolean lenientFallback = true;

	private Map<String, DataSourceProperty> datasource;

	@Data
	public static class DataSourceProperty {

		private String url;

		private String driverClassName;

		private String username;

		private String password;

	}

}
